<%@ include file="/WEB-INF/templates/jsp/include.jsp"%>
<%@ taglib prefix="basic" uri="http://ciracas.basic.org/tags-ui"%>

<script type="text/javascript">
    function doSave()
    {
        with(document.getElementById("commandBankAcc"))
        {
        	action = "<%=request.getContextPath()%><spring:message code="app.url.base"/>/master/bankacc/saveform";
            submit();
        }
    }

    function doCancel()
    {
        with(document.getElementById("commandBankAcc"))
        {
            id.value = '';
            action = "<%=request.getContextPath()%><spring:message code="app.url.base"/>/master/bankacc/cancelform";
			method = "GET";
			submit();
		}
	}

	
</script>
<div class="cssLevelTitle">
<h2><spring:message code="label.inputData" />&nbsp;<spring:message
	code="label.bankacc" /></h2>
</div>
<c:if test="${not empty commandBankAcc.msgList}">
	<br>
	<div style="color: red; font-size: 11px; font-weight: bold;">
	<ul>
		<c:forEach items="${commandBankAcc.msgList}" var="errMsg"
			varStatus="errMsgSt">
			<li>${errMsg}
		</c:forEach>
	</ul>
	</div>
</c:if>
<form:form commandName="commandBankAcc" cssStyle="feedbackform"
	method="post">
	<form:hidden path="strAction" />
	<form:hidden path="id" />
	<div class="fieldwrapper">
		<label class="styled"><spring:message code="label.accCode" /></label>
	<div class="thefield"><form:input path="accCode" maxlength="5"
		cssErrorClass="form-error-field" /></div>
	<div class="form-error-message"><form:errors path="accCode" /></div>
	</div>
	<div class="fieldwrapper"><label class="styled"><spring:message
		code="label.accNumber" /></label>
	<div class="thefield"><form:input path="accNumber" maxlength="20"
		cssErrorClass="form-error-field" /></div>
	<div class="form-error-message"><form:errors path="accNumber" /></div>
	</div>
	<div class="fieldwrapper"><label class="styled"><spring:message
		code="label.ownerName" /></label>
	<div class="thefield"><form:input path="ownerName"
		maxlength="50" cssErrorClass="form-error-field" /></div>
	<div class="form-error-message"><form:errors path="ownerName" /></div>
	</div>
	<div class="fieldwrapper"><label class="styled"><spring:message
		code="label.currency" /></label>
	<div class="thefield"><form:select items="${commandBankAcc.currencyList}"
		itemLabel="currency" itemValue="id" path="currId"
		cssErrorClass="form-error-field" /></div>
	<div class="form-error-message"><form:errors path="currId" /></div>
	</div>
	<div class="fieldwrapper"><label class="styled"><spring:message
		code="label.bank" /></label>
	<div class="thefield"><form:select items="${commandBankAcc.bankList}"
		itemLabel="name" itemValue="id" path="bankId"
		cssErrorClass="form-error-field" /></div>
	<div class="form-error-message"><form:errors path="bankId" /></div>
	</div>
	<div class="fieldwrapper"><label class="styled"><spring:message
		code="label.country" /></label>
	<div class="thefield"><form:select items="${commandBankAcc.countryList}"
		itemLabel="name" itemValue="id" path="countryId"
		cssErrorClass="form-error-field" /></div>
	<div class="form-error-message"><form:errors path="countryId" /></div>
	</div>

	<div><basic:button type="button" title="button.save"
		onclick="doSave();" /> <basic:button type="reset"
		title="button.reset" /> <basic:button type="button"
		title="button.cancel" onclick="doCancel();" /></div>
</form:form>